﻿/* 
 * Godtear.com
 * QQ:bzure@189.cn
 *Author:Nathan Liu
 */
using System;
using System.Collections.Generic;
using System.Text;
using Bzure.Common.Core;

namespace Bzure.Common.ObjectFactory
{
    /// <summary>
    /// 简单的Object Factory实现,后续再完成
    /// </summary>
    public class ObjectFactoryImpl:IObjectFactory
    {
        public object Build(Type type,params object[] args)
        {
            return Activator.CreateInstance(type, args);
        }
    }
    public class ObjectFactoryImpl<T> : IObjectFactory<T> where T:class 
    {
        public T Build ()
        {
            return Activator.CreateInstance<T>(); 
        }
        public T Build(params object[] args)
        {
            return Activator.CreateInstance(typeof(T), args) as T;
        }
    }
}
